home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / WMS.CAB / ContextSample.asp < prev    next >
Encoding:
Text File  |  2003-02-21  |  7.4 KB  |  212 lines

  1. ∩╗┐<%@ Language=VBScript CODEPAGE=65001 %>
  2. <!--#include file="include/wmsLocStrings.inc"-->
  3. <!--#include file="include/wmsServerHash.inc"-->
  4. <!--#include file="include/wmsPlugins.inc"-->
  5. <!--#include file="include/wmsHeader.inc"-->
  6. <!--#include file="include/wmsPageBanner.inc"-->
  7. <!--#include file="include/wmsError.inc"-->
  8. <!--#include file="plugin_loading.inc"-->
  9. <%
  10. '+-------------------------------------------------------------------------
  11. '
  12. '  Microsoft Windows Media
  13. '  Copyright (C) Microsoft Corporation. All rights reserved.
  14. '
  15. '  File:       ContextSample.asp
  16. '
  17. '  Contents:
  18. '
  19. '--------------------------------------------------------------------------
  20. ConnectToPlugin
  21. ConnectToPluginAdmin
  22.  
  23. BeginErrorHandling
  24.  
  25. Dim bError
  26. Dim strOutputPath
  27. Dim bUserContext
  28. Dim bPresContext
  29. Dim bCmdReqContext
  30. Dim bCmdResponseContext
  31. Dim dwContextTypes
  32.  
  33. 'typedef [public] enum WMS_CONTEXT_PLUGIN_CONTEXT_TYPE
  34. Const WMS_CONTEXT_PLUGIN_NO_CONTEXT = 0
  35. Const WMS_CONTEXT_PLUGIN_USER_CONTEXT = 1
  36. Const WMS_CONTEXT_PLUGIN_PRESENTATION_CONTEXT = 2
  37. Const WMS_CONTEXT_PLUGIN_COMMAND_REQUEST_CONTEXT = 4
  38. Const WMS_CONTEXT_PLUGIN_COMMAND_RESPONSE_CONTEXT = 8
  39.  
  40. strOutputPath = g_objPluginAdmin.OutputPath
  41. dwContextTypes = g_objPluginAdmin.ContextTypes
  42. bUserContext = CBool( 0 <> ( WMS_CONTEXT_PLUGIN_USER_CONTEXT and dwContextTypes ) )
  43. bPresContext = CBool( 0 <> ( WMS_CONTEXT_PLUGIN_PRESENTATION_CONTEXT and dwContextTypes ) )
  44. bCmdReqContext = CBool( 0 <> ( WMS_CONTEXT_PLUGIN_COMMAND_REQUEST_CONTEXT and dwContextTypes ) )
  45. bCmdResponseContext = CBool( 0 <> ( WMS_CONTEXT_PLUGIN_COMMAND_RESPONSE_CONTEXT and dwContextTypes ) )
  46.  
  47. dwTabIndex = 0
  48.  
  49. HandlePluginLoadingChanges()
  50. on error resume next
  51.  
  52. Dim szOp
  53. szOp = trim( posting( "submit" ) )
  54. if( 0 < Len( szOp ) ) then
  55.     Do
  56.         strOutputPath = CStr( trim( posting( "outputPath" ) ) )
  57.         if( 0 <> StrComp( g_objPluginAdmin.OutputPath, strOutputPath, vbTextCompare ) ) then
  58.             g_objPluginAdmin.OutputPath = strOutputPath
  59.             if( ErrorDetected( "outputPath" ) ) then
  60.                 exit Do
  61.             end if
  62.         end if
  63.  
  64.         Dim dwNewContextTypes
  65.         dwNewContextTypes = WMS_CONTEXT_PLUGIN_NO_CONTEXT
  66.  
  67.         bUserContext = CBool( "" <> posting( "userContext" ) )
  68.         if( bUserContext ) then
  69.             dwNewContextTypes = WMS_CONTEXT_PLUGIN_USER_CONTEXT
  70.         end if
  71.  
  72.         bPresContext = CBool( "" <> posting( "presContext" ) )
  73.         if( bPresContext ) then
  74.             dwNewContextTypes = CInt( dwNewContextTypes or WMS_CONTEXT_PLUGIN_PRESENTATION_CONTEXT )
  75.         end if
  76.  
  77.         bCmdReqContext = CBool( "" <> posting( "cmdRequest" ) )
  78.         if( bCmdReqContext ) then
  79.             dwNewContextTypes = CInt( dwNewContextTypes or WMS_CONTEXT_PLUGIN_COMMAND_REQUEST_CONTEXT )
  80.         end if
  81.  
  82.         bCmdResponseContext = CBool( "" <> posting( "cmdResponse" ) )
  83.         if( bCmdResponseContext ) then
  84.             dwNewContextTypes = CInt( dwNewContextTypes or WMS_CONTEXT_PLUGIN_COMMAND_RESPONSE_CONTEXT )
  85.         end if
  86.  
  87.         if( dwNewContextTypes <> dwContextTypes ) then
  88.             g_objPluginAdmin.ContextTypes = dwNewContextTypes
  89.         end if
  90.         
  91.         if ( 0 = Session( "ErrorNumber" ) ) then
  92.             if( "" <> g_strEncodedPubPointName ) then
  93.                 Response.Redirect "../pubpoints/pubpoint_props.asp?server=" & g_strQueryStringServer & "&ppID=" & g_strPubPointID & "&category=" & g_strCategory & "&pluginIndex=" & qs("pluginIndex")
  94.             else
  95.                 Response.Redirect "../server_props.asp?server=" & g_strQueryStringServer & "&category=" & g_strCategory & "&pluginIndex=" & qs("pluginIndex")
  96.             end if
  97.         end if
  98.     Loop Until TRUE
  99. end if
  100.  
  101. WriteHTMLHeader( g_strDecodedServerName ) 
  102. %>
  103. <link rel="stylesheet" type="text/css" href="<%= Session( "cssName" ) %>">
  104. <% WritePluginJSUtils %>
  105. </head>
  106. <body class="pluginBody" oncontextmenu="JavaScript:event.cancelBubble=true;return false;">
  107. <% DrawPluginBanner %>
  108. <table width="<%= STDTABLEWIDTH %>" class="propgroupbox">
  109. <tr>
  110.     <td valign=top>
  111.  
  112.         <% WriteStdPluginForm %>
  113.         
  114.         <p>
  115.          
  116.         
  117.         <table cellspacing=1 cellpadding=0 border=0>
  118.         <tr>
  119.             <td class="defaultcursor">
  120.                 <% RenderWithErrorCheck Server.HTMLEncode( "Output Path:" ), "outputPath" %>
  121.             </td>
  122.         </tr>
  123.         <tr>
  124.             <td class="defaultcursor"><% dwTabIndex = dwTabIndex + 1 %>
  125.                 <input type="text" name="outputPath" value="<%= RemoveSpecifiedChars( strOutputPath, REGEXP_DANGEROUS_CHARS ) %>" tabindex=<%= dwTabIndex %> >
  126.             </td>
  127.         </tr>    
  128.         </table>
  129.  
  130.         <p>
  131.         <span class="helptext">
  132.             Context types to show:
  133.         </span>
  134.         <table cellspacing=1 cellpadding=0 border=0>
  135.         <tr>
  136.             <td class="defaultcursor"><% dwTabIndex = dwTabIndex + 1 %>
  137.                 <input type="checkbox" name="userContext" value="on" <% if bUserContext then %>checked<% end if %> tabindex=<%= dwTabIndex %> >
  138.             </td>
  139.             <td align=left width=10>
  140.                  
  141.             </td>
  142.             <td class="defaultcursor">
  143.                 User Context
  144.             </td>
  145.         </tr>
  146.         <tr>
  147.             <td class="defaultcursor"><% dwTabIndex = dwTabIndex + 1 %>
  148.                 <input type="checkbox" name="presContext" value="on" <% if bPresContext then %>checked<% end if %> tabindex=<%= dwTabIndex %> >
  149.             </td>
  150.             <td align=left width=10>
  151.                  
  152.             </td>
  153.             <td class="defaultcursor">
  154.                 Presentation Context
  155.             </td>
  156.         </tr>    
  157.         <tr>
  158.             <td class="defaultcursor"><% dwTabIndex = dwTabIndex + 1 %>
  159.                 <input type="checkbox" name="cmdRequest" value="on" <% if bCmdReqContext then %>checked<% end if %> tabindex=<%= dwTabIndex %> >
  160.             </td>
  161.             <td align=left width=10>
  162.                  
  163.             </td>
  164.             <td class="defaultcursor">
  165.                 Command Request Context
  166.             </td>
  167.         </tr>    
  168.         <tr>
  169.             <td class="defaultcursor"><% dwTabIndex = dwTabIndex + 1 %>
  170.                 <input type="checkbox" name="cmdResponse" value="on" <% if bCmdResponseContext then %>checked<% end if %> tabindex=<%= dwTabIndex %> >
  171.             </td>
  172.             <td align=left width=10>
  173.                  
  174.             </td>
  175.             <td class="defaultcursor">
  176.                 Command Response Context
  177.             </td>
  178.         </tr>    
  179.         </table>
  180.     </td>
  181. </tr>
  182. <tr>
  183.     <td>
  184.          <br> 
  185.     </td>
  186.     <td>
  187.          
  188.     </td>
  189. <tr>
  190.     <td valign=bottom><% dwTabIndex = dwTabIndex + 1 %>
  191.         <INPUT type="submit" align="baseline" name="ok" value="<%= Server.HTMLEncode( L_OKAYBUTTON_TEXT ) %>" tabIndex=<%= dwTabIndex %> > <% dwTabIndex = dwTabIndex + 1 %>
  192.         <INPUT type="button" align="baseline" name="cancel" onclick="Cancel()" value="<%= Server.HTMLEncode( L_CANCELBUTTONSPACED_TEXT ) %>" tabIndex=<%= dwTabIndex %> > <% dwTabIndex = dwTabIndex + 1 %>
  193.     </td>
  194. </tr>
  195. </table>
  196. </font>
  197. <% RenderPluginLoadingOptions() %>
  198. </form>
  199. <% 
  200. AlertUserWithPopupErrorDialog
  201. OnErrorGoBack 
  202. DrawStdFooter
  203. %>
  204. </body>
  205. </html>
  206. <%
  207. LatchCurrentPage "plugins/ContextSample.asp", qs
  208. EndErrorHandling "ContextSample.asp" 
  209.  
  210. on error resume next
  211. PluginsASPCleanup
  212. %>